use Validation;

package ValidatePosition;
@ISA = qw/Operation/;

sub perform{
    my $self = shift;
    my $pos = $self->params->{POS};

    if(!defined($pos)){
	my ($x, $y) = ($self->params->{X}, $self->params->{Y});
	if(defined($x) && defined($y)){
	    $pos = [$x, $y];
	    $self->params->{POS} = $pos;
	}else{
	    return ActionResult->new("FAILURE", "Position NOT defined");
	}
    }

    
    return ActionResult->new("SUCCESS", "OK");
    
}

1;
